import 'package:fluwx/fluwx.dart';
import 'package:yqmssa_app/config/app_config.dart';

import 'shared_utils.dart';

///微信相关
class WechatUtils {
  WechatUtils._();

  static String xcxId = "gh_7458ca4d9c09";

  static final fluwx = Fluwx();

  ///初始化
  static initWx() {
    fluwx.registerApi(appId: "wx52373e2894ed1342", universalLink: "");
  }

  ///跳转小程序
  static Future<bool> pushWxXcx(int id) {
    return fluwx.open(target: MiniProgram(username: xcxId, path: miniProgramPath(id)));
  }

  ///小程序路径
  static miniProgramPath(int videoId) {
    return 'pages/PaymentSuccessful/PaymentSuccessful.html?video_id=$videoId&token=${sharedUtils.token}&app=${AppConfig.appName}';
  }
}
